﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
namespace DATA
{
    public class ConstREP
    {
        MODELGENERALDataContext context = new MODELGENERALDataContext();
        public int GetNewsNumberInOnePage()
        {
            try
            {
                var con = context.Consts.First();
                return con.newsNumberInOnePage;
            }
            catch (Exception)
            {
                return 5;
            }
        }

        public ConstDTO GetSupportOnlineImg()
        {
            ConstDTO conDTO = new ConstDTO();
            try
            {
                var con = context.Consts.First();
                conDTO.NewsNumberInOnePage = con.newsNumberInOnePage;
                conDTO.SkypeImgSource = con.skypeImgSource;
                conDTO.YmImgNumber = con.ymImgNumber;
                return conDTO;
            }
            catch (Exception)
            {
                return conDTO;
            }
        }
    }
}
